package com.example.xx;


import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Regx {
    private String a;

    public static void main(String[] args) {
//        extracted();
        String s = "@Table     (name = product_recommend, catalog = stellrprod)   (name = 1, catalog = 2){" +
                "private String name;" +
                "private  {}"+
                "private String ss;" +
                "    String ss2;" +
                "private java.lang.String  age;" +
                "" +
                "}";
        String regex = "(?<=(\\w{3,5}\\s)?" +
                "[\\w|.]{1,20}\\s{1,5})" +
                "\\w+;";
//        String regex = "(\\w+;)";
        Pattern compile = Pattern.compile(regex);
        Matcher matcher = compile.matcher(s);
        while (matcher.find()) {
            System.out.println(matcher.group());
        }
    }

    private static void extracted() {
        //        String s = "Abaidu.comB";
//        Pattern compile = Pattern.compile("(?<=A).*(?=B)");
        String s = "@Table     (name = product_recommend, catalog = stellrprod)   (name = 1, catalog = 2)";
//        String regex = "(?<=@Table\\s{1,10}\\().*(?=\\))";
//        String skh ="(?<=@Table\\s{1,10}\\()[^\\)]+";
        String regex = "(?<=\\()[^\\)]*";
        Pattern compile = Pattern.compile(regex);
        Matcher matcher = compile.matcher(s);
        if (matcher.find()) {
            System.out.println(matcher.group());
        }
    }
}
